/*
*********************************************************************************************************
*
*    ģ������ : ADCģ��ͷ�ļ�
*    �ļ����� : bsp_adc.h
*    ��    �� : V1.0
*    ˵    �� : 
*
*    �޸ļ�¼ :
*        �汾��   ����         ����       ˵��
*        V1.0   2024-4-5      hyf        ��
*
*新版本更新预告：
*1.不需要在宏定义添加通道数
*2.修复中文乱码
*********************************************************************************************************
*/
#ifndef BSP_DAC_H
#define BSP_DAC_H

/*������*/
#include "system.h"
#include "main.h"

/*�궨����*/

/*������ʾ��*/
/*ADC����*/
#ifndef USER_ADCx
    #error "USER_ADCx is not defined!"
#endif
/*ADC����ʱ��*/
#ifndef USER_ADCx_RCU
    #error "USER_ADCx_RCU is not defined!"
#endif
/*ͨ������*/
#ifndef USER_ADC_CHANNEL_AMOUNT
    #error "USER_ADC_CHANNEL_AMOUNT is not defined!"
#endif
/*ADCʱ��ϵ��*/
#ifndef USER_ADC_CLK_METHOD
    #error "USER_ADC_CLK_METHOD is not defined!"
#endif
/*ADC��������*/
#ifndef USER_ADC_SAMPLETIME_PERIOD
    #error "USER_ADC_SAMPLETIME_PERIOD is not defined!"
#endif
/*DMAͨ��*/
#ifndef USER_DMA_ADC_CHANNEL
    #error "USER_DMA_ADC_CHANNEL is not defined!"
#endif
/*DMA����Դ*/
#ifndef USER_DMA_ADC_SUBPERI
    #error "USER_DMA_ADC_SUBPERI is not defined!"
#endif

/*DMA_ADC�жϷ�����*/
#ifndef DMA_ADC_IRQHandler
    #error "DMA_ADC_IRQHandler is not defined!"
#endif

/*DMA_ADC�ж�Դ*/
#ifndef DMA_ADC_IRQn
    #error "DMA_ADC_IRQn is not defined!"
#endif

/*DMA_ADC ��ռ���ȼ�*/
#ifndef DMA_ADC_PRIORITY_PRE
    #error "DMA_ADC_PRIORITY_PRE is not defined!"
#endif

/*DMA_ADC �����ȼ�*/
#ifndef DMA_ADC_PRIORITY_SUB
    #error "DMA_ADC_PRIORITY_SUB is not defined!"
#endif

/*ADCͨ���������ýṹ��*/
typedef struct tag_ADC_GPIOConfig_T
{
	rcu_periph_enum Channle_RCU;//GPIOʱ��
	uint32_t Channle_GPIOx;// GPIO����
    uint32_t Channle_Pinx; // GPIO���ź�
} ADC_GPIOConfig_T;

/*ADCͨ�����ýṹ��*/
typedef struct tag_ADC_ChannelConfig_T
{
    ADC_GPIOConfig_T ADC_GPIOConfig;//ͨ����������
    uint8_t Channel;// ADCͨ����
} ADC_ChannelConfig_T;


/*������*/
void BSP_ADC_Init(ADC_ChannelConfig_T _adcChannels[]);
uint16_t BSP_ADCDataAcquire(uint8_t _index);
__weak void DMA_ADCIRQHandlerCallback(void);
#endif /* BSP_DAC_H */

/**********END OF FILE****/
